/*
 * DataProviderFactory.java
 * 
 * Created on Aug 19, 2007, 3:40:00 PM
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.oslo.data;

import org.oslo.data.ESB.ESBDataProvider;
import org.oslo.data.dummy.DummyDataProvider;

/**
 *
 * @author nl24167
 */
public abstract class DataProviderFactory {

    public final static int DUMMY_PROVIDER = 0;
    public final static int ESB_PROVIDER = 1;    
    
    public static DataProvider getDataProvider(int dataProvider) {
        DataProvider provider = null;
        if (dataProvider == DUMMY_PROVIDER) {
            provider = new DummyDataProvider();
        } else if (dataProvider == ESB_PROVIDER) {
            provider = new ESBDataProvider();
        } else {
            throw new IllegalArgumentException("Not supported dataproviderm selected");
        }
        
        provider.init();
        return provider;
    }

}
